uniform vec3 cameraPosition;
varying float Distance; 
void main()
{
    vec4 a = gl_Vertex;
    float dx = a.x - cameraPosition.x;
    float dy = a.y - cameraPosition.y;
    float dz = a.z - cameraPosition.z;
    Distance = clamp(sqrt((dx*dx)+(dy*dy)+(dz*dz)),0.0,5.0);
    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}